package net.scrumtool.view;

import net.scrumtool.technics.Utils;

import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;

public class EditCollaboratorsSprint {

	protected Shell shell;
	private Button btnEditCollaborators;
	private Table tableRemoveCollaborators;
	private TableViewer tableViewerRemoveCollaborators;
	private SashForm sashFormRemoveCollaborators;
	private Button btnEditRole;
	private Button btnSaveEditRole;
	private Label lblNameCollaboratorEditRole;
	private ComboViewer comboViewer;
	private Table tableAddCollaborators;
	private Table tableRole;
	private TabFolder tabFolder;
	private TableViewer tableViewerAddCollaborators;
	private TableViewer tableViewerRole;

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * @wbp.parser.entryPoint
	 */
	public void init() {
		createContents();
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell(SWT.CLOSE);
		shell.setSize(431, 636);
		shell.setText("SCRUMTOOL");

		Composite composite = new Composite(shell, SWT.NONE);
		composite.setBackground(Utils.COLOR_BAR_1);
		composite.setBounds(0, 0, 425, 107);

		Composite compositeNom = new Composite(composite, SWT.NONE);
		compositeNom.setBounds(10, 10, 380, 88);
		compositeNom.setBackgroundImage(Utils.getImage(Utils.IMG_LOGO));

		tabFolder = new TabFolder(shell, SWT.NONE);
		tabFolder.setBounds(0, 113, 425, 443);

		TabItem tbtmRemoveCollaborators = new TabItem(tabFolder, SWT.NONE);
		tbtmRemoveCollaborators.setText("Collaborator(s) in sprint");

		sashFormRemoveCollaborators = new SashForm(tabFolder, SWT.VERTICAL);
		tbtmRemoveCollaborators.setControl(sashFormRemoveCollaborators);

		Composite compositeTableRemoveCollaborators = new Composite(sashFormRemoveCollaborators, SWT.NONE);

		tableViewerRemoveCollaborators = new TableViewer(compositeTableRemoveCollaborators, SWT.BORDER | SWT.FULL_SELECTION);
		tableRemoveCollaborators = tableViewerRemoveCollaborators.getTable();
		tableRemoveCollaborators.setLinesVisible(true);
		tableRemoveCollaborators.setHeaderVisible(true);
		tableRemoveCollaborators.setBounds(0, 0, 417, 415);

		TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewerRemoveCollaborators, SWT.NONE);
		TableColumn tblclmnName = tableViewerColumn.getColumn();
		tblclmnName.setWidth(192);
		tblclmnName.setText("Name");

		TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewerRemoveCollaborators, SWT.NONE);
		TableColumn tblclmnRole = tableViewerColumn_1.getColumn();
		tblclmnRole.setWidth(220);
		tblclmnRole.setText("Role");

		Composite compositeEditRole = new Composite(sashFormRemoveCollaborators, SWT.NONE);

		Group grpEditRole = new Group(compositeEditRole, SWT.NONE);
		grpEditRole.setText("Edit Role");
		grpEditRole.setBounds(0, 0, 417, 138);

		Label lblCollaboratorEditRole = new Label(grpEditRole, SWT.NONE);
		lblCollaboratorEditRole.setBounds(10, 36, 72, 15);
		lblCollaboratorEditRole.setText("Collaborator :");

		lblNameCollaboratorEditRole = new Label(grpEditRole, SWT.NONE);
		lblNameCollaboratorEditRole.setBounds(107, 36, 106, 15);

		Label lblRoleEditRole = new Label(grpEditRole, SWT.NONE);
		lblRoleEditRole.setBounds(10, 75, 55, 15);
		lblRoleEditRole.setText("Role :");

		comboViewer = new ComboViewer(grpEditRole, SWT.NONE);
		Combo comboEditRole = comboViewer.getCombo();
		comboEditRole.setBounds(107, 67, 106, 23);

		btnSaveEditRole = new Button(grpEditRole, SWT.NONE);
		btnSaveEditRole.setImage(Utils.getImage(Utils.IMG_SAVE));
		btnSaveEditRole.setBounds(332, 103, 75, 25);
		btnSaveEditRole.setText("Save");
		sashFormRemoveCollaborators.setWeights(new int[] { 277, 138 });

		TabItem tbtmAddCollaborators = new TabItem(tabFolder, SWT.NONE);
		tbtmAddCollaborators.setText("Other collaborator(s)");

		SashForm sashFormAddCollaborators = new SashForm(tabFolder, SWT.NONE);
		tbtmAddCollaborators.setControl(sashFormAddCollaborators);

		Composite compositeTableAddCollaborators = new Composite(sashFormAddCollaborators, SWT.NONE);

		tableViewerAddCollaborators = new TableViewer(compositeTableAddCollaborators, SWT.BORDER | SWT.FULL_SELECTION);
		tableAddCollaborators = tableViewerAddCollaborators.getTable();
		tableAddCollaborators.setLinesVisible(true);
		tableAddCollaborators.setHeaderVisible(true);
		tableAddCollaborators.setBounds(0, 0, 207, 415);

		TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewerAddCollaborators, SWT.NONE);
		TableColumn tblclmnName_1 = tableViewerColumn_2.getColumn();
		tblclmnName_1.setWidth(202);
		tblclmnName_1.setText("Name");

		Composite compositeRole = new Composite(sashFormAddCollaborators, SWT.NONE);

		tableViewerRole = new TableViewer(compositeRole, SWT.BORDER | SWT.FULL_SELECTION);
		tableRole = tableViewerRole.getTable();
		tableRole.setLinesVisible(true);
		tableRole.setHeaderVisible(true);
		tableRole.setBounds(0, 0, 207, 415);

		TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewerRole, SWT.NONE);
		TableColumn tblclmnRole_1 = tableViewerColumn_3.getColumn();
		tblclmnRole_1.setWidth(203);
		tblclmnRole_1.setText("Role");
		sashFormAddCollaborators.setWeights(new int[] { 1, 1 });

		Composite compositeButtonsRemoveCollaborators = new Composite(shell, SWT.NONE);
		compositeButtonsRemoveCollaborators.setBackground(Utils.COLOR_BAR_1);
		compositeButtonsRemoveCollaborators.setBounds(0, 562, 425, 45);

		btnEditCollaborators = new Button(compositeButtonsRemoveCollaborators, SWT.NONE);
		btnEditCollaborators.setBounds(329, 10, 86, 25);

		btnEditRole = new Button(compositeButtonsRemoveCollaborators, SWT.NONE);
		btnEditRole.setImage(Utils.getImage(Utils.IMG_EDIT));
		btnEditRole.setBounds(238, 10, 85, 25);
		btnEditRole.setText("Edit role");

	}

	public Shell getShell() {
		return shell;
	}

	public Table getTableRole() {
		return tableRole;
	}

	public TableViewer getTableViewerRole() {
		return tableViewerRole;
	}

	public Table getTableAddCollaborators() {
		return tableAddCollaborators;
	}

	public TableViewer getTableViewerAddCollaborators() {
		return tableViewerAddCollaborators;
	}

	public TabFolder getTabFolder() {
		return tabFolder;
	}

	public ComboViewer getComboViewer() {
		return comboViewer;
	}

	public Label getLblNameCollaboratorEditRole() {
		return lblNameCollaboratorEditRole;
	}

	public Button getBtnSaveEditRole() {
		return btnSaveEditRole;
	}

	public Button getBtnEditRole() {
		return btnEditRole;
	}

	public SashForm getSashFormRemoveCollaborators() {
		return sashFormRemoveCollaborators;
	}

	public Table getTableRemoveCollaborators() {
		return tableRemoveCollaborators;
	}

	public TableViewer getTableViewerRemoveCollaborators() {
		return tableViewerRemoveCollaborators;
	}

	public Button getBtnEditCollaborators() {
		return btnEditCollaborators;
	}
}
